package factory.factorymethod;

public class PizzaStore {
    public void purchase(String loc, String type) {
        OrderPizza orderPizza = null;
        if (loc.equalsIgnoreCase("bj")) {
            orderPizza = new BJOrderPizza();
        } else if (loc.equalsIgnoreCase("ld")) {
            orderPizza = new LDOrderPizza();
        } else {
            System.out.println("没有产地为 " + loc + " 的 " + type + " 披萨");
        }
        if (orderPizza != null) {
            orderPizza.orderPizza(type);
        }
    }
}
